﻿

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Left</title>
    <style type="text/css">
        html, body, form {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            font-size: 13px;
        }

        body {
            background-color: #000;
            color: #fff;
            overflow: hidden;
        }

        #menu {
/*            margin-left: 10px;*/
            font-size: 14px;
        }

        .m-1 {
            margin-top: 10px;
        }

        .m-1-span {
            font-weight: 700;
            cursor: pointer;
        }

            .m-1-span:hover {
                background-color: #aaa;
            }

        .m-1-content {
            padding-left: 20px;
        }

        .m-2 {
        }

        .m-2-span {
            line-height: 25px;
            font-size: 12px;
            cursor: pointer;
        }

            .m-2-span:hover {
                background-color: #aaa;
            }

            .m-2-span a {
                text-decoration: none;
                color: #fff;
                display: block;
            }

        .m-2-content {
        }

        /*.m-3 {
        }

        .m-3-span {
        }

        .m-3-content {
        }*/
    </style>
    <link href="~/lib/layui2.5.6/css/layui.css" rel="stylesheet" />
</head>
<body>
    <div class="layui-side-scroll">
        @*<div style="height:40px;line-height:40px;text-align:center;width:150px;margin:10px 0;font-size:20px;">
                <span>FrameCore</span>
            </div>*@
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test" style="width:150px;margin-top:30px;" id="menu">
            @*<li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">主页</a>
                <dl class="layui-nav-child">
                    <dd class="layui-this"><a href="/home/overview" target="mainpage">概览</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;">前台内容</a>
                <dl class="layui-nav-child">
                    <dd><a href="/article/index" target="mainpage">新闻公告</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;">系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="/user/index" target="mainpage">用户管理</a></dd>
                    <dd><a href="/dept/index" target="mainpage">部门管理</a></dd>
                    <dd><a href="/role/index" target="mainpage">角色管理</a></dd>
                    <dd><a href="/module/index" target="mainpage">模块管理</a></dd>
                    <dd><a href="/link/index" target="mainpage">数据字典</a></dd>
                    <dd><a href="/log/index" target="mainpage">日志</a></dd>
                </dl>
            </li>*@
        </ul>
    </div>

    <script src="/lib/jquery/dist/jquery.js"></script>
    <script src="~/lib/layui2.5.6/layui.js"></script>
    <script>
        $(function () {
            $.ajax({
                url: "/Home/Menu",
                type: "GET",
                success: function (data) {
                    var html = "";

                    $.each(data, function (index, value) {
                        html += '<li class="layui-nav-item layui-nav-itemed">';
                        html += '<a class="" href="javascript:;">' + value.title + '</a>';
                        html += '<dl class="layui-nav-child">';
                        $.each(value.childNodes, function (indexChild, valueChild) {
                            if (valueChild.title == "概览") {
                                html += '<dd class="layui-this">';
                            } else {
                                html += '<dd>';
                            }
                            html += '<a href="' + valueChild.url + '" target="mainpage">' + valueChild.title + '</a>';
                            html += '</dd>';
                        });
                        html += '</dl>';
                        html += '</li>';
                    });
                    //debugger;
                    $("#menu").html(html);

                    //导航 依赖 element 模块
                    layui.use('element', function () {
                        var element = layui.element;
                    });

                }
            });
        });
        
    </script>
</body>
</html>
